package org.mmtk.plan.colormark;

import org.mmtk.plan.StopTheWorldConstraints;
import org.mmtk.plan.scale.ScaleMarkSweepSpace;
import org.mmtk.policy.SegregatedFreeListSpace;
import org.vmmagic.pragma.Uninterruptible;

/**
 * This class and its subclasses communicate to the host VM/Runtime any features
 * of the selected plan that it needs to know. This is separate from the main
 * Plan/PlanLocal class in order to bypass any issues with ordering of static
 * initialization.
 */
@Uninterruptible
public class CMConstraints extends StopTheWorldConstraints {
	@Override
	public int gcHeaderBits() {
		return ScaleMarkSweepSpace.LOCAL_GC_BITS_REQUIRED;
	}

	@Override
	public int gcHeaderWords() {
		return ScaleMarkSweepSpace.GC_HEADER_WORDS_REQUIRED;
	}

	@Override
	public int maxNonLOSDefaultAllocBytes() {
		return SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES;
	}

	@Override
	public int numSpecializedScans() {
		return 2;
	}
}
